<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ include file="/WEB-INF/jsp/commons/includes.jsp" %>

<c:forEach var="cur" items="${treeList}" varStatus="vs">
    <c:set var="index" value="${index + 1}" scope="request" />
    <dl class="cate-item">
        <dt class="cf">
        <form action="" method="post">
            <div class="btn-toolbar opt-btn cf">
                <a title="编辑" href="">编辑</a>
            </div>
            <div class="fold"><i></i></div>
            <div class="order"><input type="text" name="sort" class="text input-mini" value="${cur.id}"></div>
            <div class="order">${cur.id}</div>
            <div class="name">
                <span class="tab-sign"></span>
                <input type="hidden" name="id" value="${cur.id}">
                <input type="text" name="title" class="text" value="${cur.id}">
                <a class="add-sub-cate" title="添加子分类" href="">
                    <i class="icon-add"></i>
                </a>
                <span class="help-inline msg"></span>
            </div>
        </form>
        </dt>
        <c:if test="${not empty cur.children}">
            <c:set var="level" value="${level + 1}" scope="request" /><!-- 循环一次子列表，level+1 -->
            <c:set var="treeList" value="${cur.children}" scope="request" /><!-- 注意此处，子列表覆盖treeList，在request作用域 -->
            <dd>
                <c:import url="/tree.jsp"/>
            </dd>
        </c:if>
    </dl>
</c:forEach>